package com.avic.rong.course.showapi;

import com.avic.rong.api.HttpPostService;
import com.example.minato.minastore.BaseApi;
import com.example.minato.minastore.listener.HttpOnNextListener;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import io.reactivex.Observable;
import retrofit2.Retrofit;

public class PeiXunListApi extends BaseApi {

    private String type;
    private String classifyName;
    private int pageNo = 1;
    private int pageSize;
    private String orderBy;

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public PeiXunListApi(RxAppCompatActivity rxAppCompatActivity, HttpOnNextListener listener, String type, String classifyName, int pageSize, String orderBy) {
        super(rxAppCompatActivity, listener);
        this.type = type;
        this.classifyName = classifyName;
        this.pageSize = pageSize;
        this.orderBy = orderBy;
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService httpPostService = retrofit.create(HttpPostService.class);
        return httpPostService.getCourseListConditions(type,classifyName,pageNo,pageSize,orderBy);
    }
}
